using System;

namespace RandomSearch.VM {
    public class ParameterizedDelegateCommand<T> : DelegateCommand<T> {
        public ParameterizedDelegateCommand(Predicate<T> canExecute, Action<T> execute)
            : base(canExecute, execute) {}

        public ParameterizedDelegateCommand(Action<T> execute)
            : base(execute) {}

        public override bool CanExecute(object parameter) {
            return parameter != null && base.CanExecute(parameter);
        }
    }
}